﻿# encoding: utf-8
######################  创建cell  #####################################
require "iconv"
require_relative "cell"
require_relative "register"

to_gb2312= Iconv.new("gb2312", "utf-8") # utf-8 转为 gb2312
to_utf8= Iconv.new("utf-8", "gb2312") # gb2312 转为 utf-8

io=File.open("words.txt","r")         ########===>>  读取词汇文件并创建 cell 的对象
while name = io.gets
	name.chomp!
	print name+" "
	print name.encoding.name
	puts
	#puts name==to_gb2312.iconv("吃饭")
	cell=Cell.new
	register(name,cell)
end                               ###### <<===#读取词汇文件并创建 cell 的对象

#test-----//
p $h_cell[to_gb2312.iconv("吃饭")].attribute[0]

